# f = open("z.txt","a",encoding="utf-8")
# f.write(("想死的8月\n八月十六号:不需要理由"))
# f.close()
# with open("d:\\y.txt","w",encoding="utf-8") as f1:
#     f1.write("我是傻逼")
# with open("../y.txt","w",encoding="utf-8") as f1:
#     f1.write("我是傻逼\n你也是傻逼\n他也是傻逼")
file = open("z.txt", "r", encoding="utf-8")
# print(file.read())
# while True:
#     line = file.readline()
#     # 当读取到空时，退出循环
#     # if line == "":
#     if not line:
#         break
#     print(line)
# text = file.readlines()
# print(text)
# file.seek(0)
# print(file.readline())
# file.close()
import csv
# with open("score.csv","a",encoding="utf-8") as f:
# f.write("小白，23\n小黄，44")
# f.write("\n小黑，34")
#     w = csv.DictWriter(f,fieldnames=["姓名","成绩"])
#     w.writerow({"姓名":"大傻逼","成绩":65})
#     w.writerows([{"姓名": "二傻子", "成绩": 67}, {"姓名": "三孙子", "成绩": 67}, {"姓名": "四该溜子", "成绩": 67}])

      # w = csv.writer(f)
      # w.writerow(["赵六",78])
      # w.writerows([["张三",90],['李四',78],['王五',89]])

# with open("score.csv","r",encoding="utf-8") as f:
#     reader1 = csv.reader(f)
#     print(list(reader1)) # 将reader1对象里面的内容强转为列表
#     for lineText in reader1: # lineText里面是一行数据 lineText类型为列表
#         print(lineText,lineText[0],lineText[1])
# print("-------------------")
# with open("score.csv","r",encoding="utf-8") as f1:
#     reader2 = csv.DictReader(f1)
#     for row in reader2:  # row是一行数据，类型为字典
#         print(row,"-->",row.get("姓名"),'-->',row["成绩"])

# 复制图片

# with open(r"d:\snick.jpeg","rb") as f:
#     a = f.read()
# with open(r"d:\snick1.jpeg","wb") as f1:
#     f1.write(a)

# 枚举
# 水仙花数 每位数的立方和=数

# for i in range(1000):
#     a = i//100
#     b = i//10%10
#     c = i%10
#     if a ** 3 + b ** 3 + c ** 3 == i:
#         print(i)

